import 'package:flutter_test/flutter_test.dart';
import 'package:external_sdk/external_sdk.dart';
import 'package:external_sdk/external_sdk_platform_interface.dart';
import 'package:external_sdk/external_sdk_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockExternalSdkPlatform
    with MockPlatformInterfaceMixin
    implements ExternalSdkPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ExternalSdkPlatform initialPlatform = ExternalSdkPlatform.instance;

  test('$MethodChannelExternalSdk is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelExternalSdk>());
  });

  test('getPlatformVersion', () async {
    ExternalSdk externalSdkPlugin = ExternalSdk();
    MockExternalSdkPlatform fakePlatform = MockExternalSdkPlatform();
    ExternalSdkPlatform.instance = fakePlatform;

    expect(await externalSdkPlugin.getPlatformVersion(), '42');
  });
}
